﻿
using Game.Map.Extensions.Internal;

namespace Game.Map.Extensions
{
    public static class Module
    {
        public static void Register()
        {
            MapConfig.MapExtensions.Add(new MapSelectedExtensionFactory());
            MapConfig.MapExtensions.Add(new MapMoveExtensionFactory());
            MapConfig.MapExtensions.Add(new MapClickExtensionFactory());
            MapConfig.MapExtensions.Add(new MapMoveExtensionFactory());
            //MapConfig.MapExtensions.Add(new ViewExtensionFactory());
            
            MapConfig.FieldExtensions.Add(new VehicleExtensionFactory());
            MapConfig.FieldExtensions.Add(new TerrianExtensionFactory());
            MapConfig.FieldExtensions.Add(new GameObjectExtensionFactory());
            MapConfig.FieldExtensions.Add(new FieldSelectExtensionFactory());
            MapConfig.FieldExtensions.Add(new ViewExtensionFactory());

            MapFieldFactory.SetupField += (source, args) => new MovingExtension(args.GameMap, args.MapField);
            MapFieldFactory.SetupField += (source, args) => args.MapField.Extensions.Add(new MovingExtension(args.GameMap, args.MapField));

            MapViewFactory.SetupView += (source, args) => new VisibleUpdater(args.View);
            MapViewFactory.SetupView += (source, args) => new VisibleUpdater2(args.View);
        }
    }
}
